package com.hxz.admin.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

import com.hxz.admin.mapper.AdminArticleModifyMapper;
import com.hxz.admin.service.AdminArticleModifyService;
import com.hxz.entity.Article;
/**
 * 文章修改Service实现类
 * @author hxz
 * @description TODO
 * @data 2019年12月5日 上午9:32:59
 */
@Service
public class AdminArticleModifyServiceImpl implements AdminArticleModifyService {
	@Autowired
	private AdminArticleModifyMapper modifyMapper;

	public List<Article> getArticleList() {

		return modifyMapper.getArticleList();
	}
	
	public Article getContents(String id) {
		return modifyMapper.getContents(id);
	}
	@CacheEvict(value="findArticleById",key="'detail_'+#id" ,allEntries=true)
	public Integer updateArticle(Article article) {
		
		return modifyMapper.updateArticle( article);
		
	}

	public Integer deleteArticleById(Integer id) {
		
		return modifyMapper.deleteArticleById(id);
	}

}
